//
// RS Game Framework
// Copyright © 2010 Jedd Haberstro
// jhaberstro@gmail.com
// 
// $Id:
//

#ifndef RS_GRAPHICS_BUFFERDESCRIPTION_HPP
#define RS_GRAPHICS_BUFFERDESCRIPTION_HPP

#include "rs/graphics/ResourceDescription.hpp"

namespace rs
{
    namespace graphics
    {
        class BufferDescription : public ResourceDescription
        {
            RS_DECLARE_POLYMORPHIC_REFLECTION();
            
        public:
            
            BufferDescription(UInt32 count, UInt32 elementSize, ResourceType::Enum type, ResourceAccess::Enum access, ResourceUsage::Enum usage);
            
            UInt32 GetSize() const;
                        
            UInt32 GetCount() const;
            
            void SetCount(UInt32 count);
            
            UInt32 GetElementSize() const;
            
            void SetElementSize(UInt32 elementSize);
            
        protected:
            
            UInt32 count_;
            UInt32 elementSize_;
        };
        
                
        inline BufferDescription::BufferDescription(UInt32 count, UInt32 elementSize, ResourceType::Enum type, ResourceAccess::Enum access, ResourceUsage::Enum usage)
        : ResourceDescription(type, access, usage),
          count_(count),
          elementSize_(elementSize) {
        }
        
        inline UInt32 BufferDescription::GetSize() const {
            return count_ * elementSize_;;
        }
        
        inline UInt32 BufferDescription::GetCount() const {
            return count_;
        }
        
        inline void BufferDescription::SetCount(UInt32 count) {
            count_ = count;
        }
        
        inline UInt32 BufferDescription::GetElementSize() const {
            return elementSize_;
        }
        
        inline void BufferDescription::SetElementSize(UInt32 elementSize) {
            elementSize_ = elementSize;
        }
    }
}

#endif // RS_GRAPHICS_BUFFERDESCRIPTION_HPP